package com.augurit.common.dao;

import org.springframework.stereotype.Repository;

import com.augurit.common.base.dao.BaseDao;
import com.augurit.common.entity.AtLoginLimit;
import com.augurit.common.system.web.org.form.AtLoginLimitForm;

/**
 * 登录限制DAO类
 */
@Repository
public class AtLoginLimitDao extends BaseDao<AtLoginLimit, Long> {

	public AtLoginLimitForm getForm(Long id){
		AtLoginLimitForm form = null;
		
		if(id != null){
			AtLoginLimit entity = this.get(id);
//			if(entity != null)
//				form = (AtLoginLimitForm)DozerUtils.map(entity, AtLoginLimitForm.class);
		}

		return form;
	}
	
	/**
	 * 保存登录限制Form对象
	 * @param form 登录限制Form对象
	 */
	public void save(AtLoginLimitForm form){
		
		if(form != null){
			AtLoginLimit entity = null;
			
			//准备VO对象
			if(form != null && form.getLimitId() != null){
				entity = this.get(form.getLimitId());
			}else{
				entity = new AtLoginLimit();
			}
			
			//属性值转换
//			DozerUtils.map(form, entity);
			
			//保存
			super.save(entity);
			
			//回填ID属性值
			form.setLimitId(entity.getLimitId());
		}
	}

}
